package br.com.duosoftware.orcamento.managedbeans;

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
import org.primefaces.component.accordionpanel.AccordionPanel;
import org.primefaces.event.TabChangeEvent;

/**
 *
 * @author Daniel
 *
 */
@ManagedBean
@SessionScoped
public class AcoordionBean implements Serializable {

    private int activeIndexLeft;
    private int activeIndexRight;

    public AcoordionBean() {
    }

    public int getActiveIndexLeft() {
        return activeIndexLeft;
    }

    public void setActiveIndexLeft(int activeIndexLeft) {
        this.activeIndexLeft = activeIndexLeft;
    }

    public int getActiveIndexRight() {
        return activeIndexRight;
    }

    public void setActiveIndexRight(int activeIndexRight) {
        this.activeIndexRight = activeIndexRight;
    }

    public void onTabChangeLeft(TabChangeEvent event) {
        String index = ((AccordionPanel) event.getComponent()).getActiveIndex();
        activeIndexLeft = Integer.parseInt(index);
    }

}
